package com.yk.alertdialog;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.yk.alert_dialog.AlertDialog;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void showDialog(View view) {
        new AlertDialog(this) {
            @Override
            public void positive(AlertDialog dialog) {
                Toast.makeText(MainActivity.this, "弹窗提示", Toast.LENGTH_SHORT).show();
                dialog.dismiss();
            }
        }
                .setDialogTitle("弹窗提示")
                .setDialogContent("提示内容")
                .show();
    }
}